import request from '@/request/request'


export const GetHomeList =() => request.get('/index/index')

// 获取搜索框数据
export const GetSearchPopupData = () => request.get("/search/index")

// 搜索文本框改变时，获取搜索关联的数据
export const GetSearchTipList= (params) => request.get("/search/helper",{params})

// 搜索商品的数据
export const getProducts= (params) => request.get("/goods/list",{params})

// 删除历史记录
export const deleteHistory= () => request.post("/search/clearhistory")

// 登录接口
export const UserLogin= (params) => request.post("/auth/loginByWeb",params)

// 根据id，获取商品详情
export const GetProductsDetailById= (params) => request.get("/goods/detail",{params})

// 根据id，获取商品先关的文字信息
export const GetProductRelated= (params) => request.get("/goods/related",{params})

// 获取购物车数量
export const getCartCount= () => request.get("/cart/goodscount",)

// 添加购物车
export const addProductToCart = params => request.post("/cart/add",params)

// 获取购物车数据
export const getCartList = params => request.post("/cart/index",params)

// 获取购物车数据
export const changeProductChecked = params => request.post("/cart/checked",params)

// 步进器更改
export const changeSetpper = params => request.post("/cart/update",params)

// 删除购物车商品
export const deleteProduct = params => request.post("/cart/delete",params)

// 获取分类数据
export const getCatalog= () => request.get("/catalog/index")

// 获取分类数据
export const getTopicList= (params) => request.get("/topic/list",{params})

// 获取当前分类数据
export const getCatglogCurrent= (params) => request.get("/catalog/current",{params})


